package cn.doit.scala.day03

/**
 * @DATE 2021/12/27/17:04
 * @Author MDK
 * @Version 2021.2.2
 * */
object C13_Sorted {
  def main(args: Array[String]): Unit = {
    val list: List[Int] = List(1, 99, 34, 67, 23, 15, 76)
    val arr: Array[String] = Array[String]("java", "hbase", "spark", "flink", "scala")

    //map集合不能直接排序 需要转换成list集合 默认按照key升序排序
    val mp: Map[String, Int] = Map[String, Int]("aa" -> 5, "edg" -> 3, "fgh" -> 7, "shd" -> 9)
    val res1 = list.sorted
    println(res1)

    val res2 = arr.sorted
    println(res2.toList)

    val res3 = mp.toList.sorted
//    println(res3)
    res3.foreach(e=>print(e+"\t"))
  }
}
